<template id="store_info">
    <div class="pm-active-msg">
        <!--门店信息-->
        <div class="pm-prize-shop-msg-wrap-wrap">
            <div class="pm-positionR">
                <img class="pm-prize-active-data" v-lazy="staticImageUrl('images/shop_msg.png')" alt="" />
                <span class="pm-title">{{pageDefault.title}}</span>
            </div>
            <div class="pm-prize-shop-msg-wrap">
                <img v-if="pageDefault.store.poster" @click="$emit('storeHref',pageDefault.store.storeId)" class="pm-prize-active-data store-info-poster" :src="pageDefault.store.poster" alt="门店海报" />
                <div class="pm-prize-shop-msg">
                    <!--TODO 这个功能没做，先隐藏-->
                    <div class="pm-mark" v-if="false">
                        <span class='pm-mark-item' v-for="value in pageDefault.pageDefault.markArr">
                            <span class="pm-cricle">
                                <span class="pm-gou"></span>
                            </span>
                            <span>{{value}}</span>
                        </span>
                        <span class="pm-right-assass"></span>
                    </div>
                    <!--<p @click="openMap()"><img class="pm-prize-location" v-lazy="staticImageUrl('images/prize_icon_location.png')" alt="" />{{store.location}}</p>-->
                    <!--<p>-->
                    <!--<img class="pm-prize-location" v-lazy="staticImageUrl('images/prize_icon_phone.png')" alt="" />-->
                    <!--<a class="pm-prize-location" v-for="phone in store.phones" :href="telPhone(phone)">{{phone}}&nbsp;</a>-->
                    <!--</p>-->
                    <div class="pm-prize-location-wrap" @click="openMap()"  v-if="pageDefault.store.location && pageDefault.store.location.length > 0">
                        <i class="iconfont icon-dingwei"></i>
                        <p>{{ pageDefault.store.location }}</p>
                    </div>
                    <div class="pm-prize-phone-wrap" v-if="pageDefault.store.phones && pageDefault.store.phones.length > 0">
                        <i class="iconfont icon-dianhua"></i>
                        <p><a class="pm-prize-location" v-for="phone in pageDefault.store.phones" :href="'tel:'+telPhone(phone)">{{ phone }}</a></p>
                    </div>
                </div>
            </div>
        </div>
        <!--门店信息end-->
    </div>
</template>
<script>
    import xurl from '../../../../../x/xurl'
    var wx = require('weixin-js-sdk');
    export default {
        name: 'store_info',
        props: {
            storeInfoMsg: Object
        },
        data() {
            return {
                pageDefault:{
                    title:'门店信息',
                    store:{
                        'poster':'',
                        'location':'',
                        'phone':10086
                    },
                    markArr: ['实体门店', '品牌店', '售后无忧', '个性定制', '免费咨询', '免费维修', '免费清洗', '个性包装'],
                },
            }
        },
        mounted: function () {
            Object.assign(this.pageDefault,this.storeInfoMsg)
        },
        methods: {
            telPhone: function (phones) {
                return "tel:" + phones[0];
            },
            openMap: function () {
                wx.openLocation({
                    latitude: this.store.latitude,
                    longitude: this.store.longitude,
                    name: this.store.name,
                    address: this.store.location,
                    scale: 1,
                    infoUrl: ''
                });
            },
            itemImgStyle: function (img) {
                var imgUrl = imageSys + img;
                var style = {
                    "background": "url('" + imgUrl + "') no-repeat center center /cover"
                };
                return style;
            },
        }
    }

</script>
<style lang="scss" scoped>
    @import url($css_root + 'css/components/activeMsg.css');
    .pm-prize-location-wrap,.pm-prize-phone-wrap{
        padding-left: .1rem;
        width: 100%;
        box-sizing: border-box;
        position: relative;
        .iconfont{
            position: absolute;
            left: 0;
        }
    }
    .icon-dianhua{
        top: .02rem;
    }
    .pm-prize-shop-msg{
        line-height: .3rem;
    }
    .store-info-poster{
        pointer-events: auto;
    }
</style>
